1. Field of the Invention
The present invention relates to a retaining device for electronic components, and more particularly to a retaining device for a sensor.
2. Descriptionn of the Related Art
When using a computer, a user may need to know the state of an enclosure of the computer for safety and maintenance reasons. A sensor installed in the enclosure can detect whether a cover of the enclosure is in a closed position. Taiwan Patent No. 215298 discloses a retaining device for a sensor switch. The retaining device comprises a rectangular bottom wall, and a plurality of holes is defined in the bottom wall. An elastic obtuse sidewall extends upwardly from one end of the bottom wall, and an L-shaped sidewall extends from an opposite end of the bottom wall. In assembly, the obtuse sidewall is pushed outwardly, and a switch is received between the obtuse and L-shaped sidewalls. The obtuse sidewall is then released, whereupon it rebounds and clamp the switch between the obtuse and L-shaped sidewalls. A plurality of screws is extended into the holes of the bottom wall for fastening the combined switch and retaining device to another device. However, the retaining device only restricts movement of the switch along a first axis that is perpendicular to the obtuse and L-shaped sidewalls. The retaining device does not restrict movement of the switch along a second axis that is parallel to the obtuse and L-shaped sidewalls. In addition, attachment of the retaining device using screws is unduly laborious and time consuming. Furthermore, a tool is usually required for installation and removal of the screws.
Accordingly, an object of the present invention is to provide a retaining device which enables a sensor to be easily and securely attached to a computer enclosure.
To achieve the above object, a retaining device for a sensor in accordance with the present invention comprises a front wall, a rear wall and a sidewall connecting between the front wall and the rear wall. A pair of poles extends perpendicularly inwardly from the sidewall. A pair of L-shaped hooks is arranged at the front and rear walls respectively. The sensor defines a pair of through holes. In assembly, the sensor is received in the retaining device, with the poles of the retaining device being received in the through holes of the sensor. The combined retaining device and sensor is then attached to an internal side panel of a computer enclosure. The hooks resiliently engage with the internal side panel at apertures thereof.
Other objects, advantages and novel features of the present invention will be drawn from the following detailed description of a preferred embodiment of the present invention with the attached drawings, in which: